<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .header{
        width: 100%;
        height: 100px;
        background-color: red;
    }
    .footer{
        width: 100%;
        height: 100px;
        background-color: green;
    }
    .content{
        height: 300px;
       
        padding-left: 100px;
        padding-right: 100px;
    }

    .middle{
        height: 300px;
        float: left;
        background-color: purple;
        width: 100%;
    }
    .left{
        height: 300px;
        width: 100px;
        float: left;
        background-color: blue;
        margin-left: -100%;
        position: relative;
        right: 100px;
    }
    .right{
        width: 100px;
        height: 300px;
        float: left;
        background-color: black;
        margin-right : -100px;
        /* 这里要注意 */

        /* text-align: center; */
    }

</style>
<body>
    <h1>圣杯 float</h1>
    <div class="header"></div>
    <div class="content">
        <div class="middle">center</div>
        <div class="left">left</div>
        <div class="right">right</div>
    </div>
    <div class="footer"></div>

    
    <h1>圣杯 flex</h1>
    <br>

    <div class="header"></div>
    <div class="content1">
        <div class="middle1">center</div>
        <div class="left1">left</div>
        <div class="right1">right</div>
    </div>
    <div class="footer"></div>

    <style>
        .content1{
            display: flex;
            height: 200px;
        }
        .left1{
            order: 1;
            flex: 0 0 200px;
            background-color: yellow;
        }
        .middle1{
            order: 2;
            flex: 1;
            background-color: blue;
        }
        .right1{
            order: 3;
            flex: 0 0 200px;
            background-color: green;
        }
    </style>
    
</body>
</html>